Rewrite collector to CoffeeScript