Well, one thing I see now...you can remove begin..end if you use this form or if you want explicit ensure around yield, then you should use
```
saved_env = ENV.to_hash 
begin
  yield
ensure
  ENV.replace saved_env
end
```