Extract AttributeFinder class.
Avoid duplication and extract AttributeFinder class
Made condition more truthy.
Improve readability and reduce repetition.