optimize Dequeue