major rewrite to support multiple message sections