Implemented batching.