refactor for kv factory method
refactor for consistent cache() factory method