Split code + add withInventoryCheck option