refactoring double negative check.