Simplify if expression