Refactor home page view to use template