rewrite adapter