As @ediosyncratic mentioned not clear why changed switch to set of if else conditions.