JavaScript and Main index.js structure changes.