split batchInsert to smaller batches to prevent running out of memory
cleanup and switch to best insertion variant
add some strictness annonations. not a 100% sure about this ones.