rewrite core