context refactoring