adapted process factory to context refactoring