refactor homepage