Some controller refactoring.