threading, queue, and unified class