simplify if statement