Refactoring of controllers