better multipart and contained messages implementation