Change if/else conditions into switch.