split main.js in 4 files