Refactored thread queues to be used independently