Refactor ConstantFoldingVisitor