Refactor the thread/queue logic into the idea of threadactor.