rewrite wrapper