code rewriting