refactor the memcache client