rework message handling