added checking of thread ids to be distinct + changes to avoid redundant fields and long field names