I don't get why we need to have this foreach at all. We have glob iterators which let you handle this without having to check each reference's name this high up the stack.