Fixed incomplete refactoring of controller