Improved the method to check is a basic type