Original codes of kvstore