If I am not mistaken, here ```i``` can be either ```None```, or an integer, or a string. Then, you select the behavior by type matching. Could we just keep the fields in an ordered dictionary (so, by removing name2index) and use only strings instead of field ordinals?