use priority_queue for the outbound queue and minor constness