pre-test rewrite