rewrite using coffee