refactored home.js a bit