Refactored schema fetching.