Minimize boolean expression branching