make _gatherRefs non-recursive