application.js: split main into two files