restructure the keeper, add function writekv