If I understand correctly, this function implements default lookups for both resources and types. However there isn't a huge overlap in the code between them, and testing both behaviors seems very tricky. Should this be one function or two?