Small Performance Update

Replaced massive if / elseif with a switch