refactor home page to use a template