Use when/case rather than else(if).