do we need count and threadsBatch on this, or couldn't we just put them as local variables here? I like colocated code :)