refactor and home page