Refactored defbatch.