refactored further to remove clutter from home controller