rewriting methodology