refactor homepage view to use a template