More refactoring for controllers