A bit of refactoring and cleanup
A bit more cleanup, refactoring
Refactor Environment out of the normal flow