refactoring controllers and validations