Rewrite with class style of coffeescript