refactor batchable