XD-2467 wip
reuse code for receiver and sender