Refactoring from ThreadPool and Thread work items to corresponding Task constructs