Refactor homepage view to use template