Refactor to handle batches later