improved custom message format-handler