Refactor `is` and `is not` to handle all types