Refactor the home controller