rewrite with coffee script