Shift scope of cache to object (and rename var)