moved the models to app/models and refactored files