multithreading for extraction