Prepare for batch