Extracting a class to find values in enclosing class