Removed unnecessary lines in case..when

Ruby allows for class check in case..when