add threads parameter to speedup conversion