Refactoring env