Generate better if/multi-if