remove dependence on AST rewriting