Rewrite to CoffeeScript