rename and clean for rewrite