Refactored homepage to use template