handle kv types