Instead of having two if structure, can we make this an `if else`?