preprocessing batched