Refactored for multithreaded, queue-based network