adapted recover process to context refactoring