actually return in seen_ref and seen_defn to avoid duplicates