[cleanup] Use referenceElement.subEntities(...).contains(...)
We no longer need to build up this information manually, because the reference elements now provide and cache it.
We no longer need to build up this information manually, because the reference elements now provide and cache it.