refactoring, new rules and affine terms