Reduce code duplication in CSV<->CSKV converters