refactoring around Environment