Rewrited on CoffeeScript