coffeescript working, but ugly