rewrite with CoffeeScript