Revert the switch statement change. It is way slower.