Modularize the message handlers