completes home.js refactor