condense contiguous group codes / types