consolidate counts and kv in the same key structure