Rework enqueue code
Updates #26117