Refactoring for Workers and multiple Threads