pre rewrite