refs: introduce an iterator This allows us to get a list of reference names in a loop instead of callbacks.