Refactored home.js