Turn two if blocks into a single if-elseif