Rewrite of environments