refs: change the internal reference-iteration API