Move JS to mainJS file