Use if/else instead of goto