Rewrite app in coffeescript