Update deprecated switch use