Switch to queue pattern from std lib.