More changes to support refid->ref name