Reduce casting and use a fully covered switch.