Refactor home controller