Refactored homepage controller