before rewriting