Refactored index.js and missing dependencies