Optimizing branch indices