Rewrite into CoffeeScript