Refactor home page to view as a template