get_type() optimization