Move JS into main.js