some refactoring, mainly of ThreadPool references