Refactor HomePageController.