Improved batch mode by using thread pools and queues