refactor of orca rebuild batches