This whole `if` block is exactly the same as in `convertBooleans()` except for the values of `true` and `false`. Would be nice to avoid code duplication through another private method here IMO.