Added option for sorted InstanceIndex, using RBTree