home controller refactoring