merge/simplify 2 if()