refactor homepage to use a template