Function extractSchema