generic library for using KVS