Rewrite into coffeescript