improvements to AutoBatch