Updated to use a pool or worker threads