plumbing for message parsing and dispatch