refactored environment