Revert "Make Homepage code simpler"

This reverts commit e81126eed334a117ba7281c59476af8112e014a2.

Commit reverted due to problems with login page (not redirecting to homepage). Also, homepage code is going to be more complex anyway.