Refactored homepage view to use a template