Refactoring setCache method of clientAdapter