There are many places where we are doing the following: PayloadHelper.GetTypeId(): if (type == typeof(int)) { return new[] { Convert.ToByte('i') }; } if (type == typeof(long)) { return new[] { Convert.ToByte('g') }; } .. Use C#'s[ pattern matching](https://docs.microsoft.com/en-us/dotnet/csharp/pattern-matching) instead if applicable.