Refactored Environment into trait & object