Refactor home.js