Improved searching and checking of types in type tree