add batchHandler so that the batches can be speifically typed and avoid unchecked warnings