slightly improved my coffeescript code