Refactor home page viwto use a template