Renamed tryToGetTopClass to tryToGetRootClass