refactor into batchs package