improved is_unit()