Code duplication fix in MemcachedAdapter