revamped message handling