can we maybe replace this with a `switch` statement?