simplify if clause