refactoring Environment to Context