Refactored is_* ctype functions