refactor home_controller