Rewrite JS to CoffeeScript