Refactor find_basic_type function into ctx.basic_type_of
Refactor basic_type_of method