Simplify, get rid of mutable state for environment.