Replacing cache get function with object