Extended the searching for classes to check nested classes as well