CoffeeScript rewrite