simplify conditional branches (5 -> 3)