Extracted some handlers for server message processing.