Cardinality to optional and multiple, refactors, removing ReferenceAttr