use coffeescript to rewrite