some improvements to the thread pool