Swap switch to if else.

Signed-off-by: crynobone <crynobone@gmail.com>