make the cardinality datastructures serializable