split out message and handler