might want to extract the kv serivce here if you add some tests?