Refactored schema lookup