rewrite the pass-refactoring script