Refactored from Threadpool to Task