Branching optimization