I would like to solve this differently as I don't like to have mpipe specific code here. I think introducing a callback that is invoked here would make sense.