Move index js to main.js