refactoring memcached