refactored Environment to be singleton