Optimization 3 if's -> 1 if.