replace if-else with ternary expression 'cond ? exp1 : exp2'