rewrite instances