Rewrite in coffeescript.