Replace if and nots with if-not