Rewrite plugin in CoffeeScript