serialization redone to speed up hl7 processing