Refactoring of controller methods