refactoring environment