make string2KV more general to use