Using if/else if instead of continue