Simplify if statement