Env refactoring