Prepare rewrite