bug 1255: Use if blocks instead of switch because big switches are easy to