Moving all scripts into main.js