Apply some refactorings to the controllers