Refactoring crud controller.