simplify if statements