refactoring logic in controllers to model files