Clean up coffeescript code a bit