Refactor home page to use template