Refactored the logic to determine if something comes from a ResolvedValueSet.