Removing unnecessary if/elseif