Replace given/when with good ol' if/else because it becomes experimental in 5.18 [RT#95630]