Simplify code with if-not.