rework messaging functionality