smarter batching