Refactored schemas into models