uses threadpool