homecontroller refactoring