fix model and schema
refactoring