refactored schema