Break up the logic for finding the delegate class into dedicated methods.