Move NUM_THREADS to settings