Rearrange app.js a bit