Better generalizing the environment rewrites.