split the app.js code