Refact app.coffee