Extract the queue into its own class