refactor the home.js