Added configurable batch size.