homecontroller refactor