Copied back the updated code of WorkerFactory from the last Master commit