rename and rewrite