Most of this block was duplicated in the VanillaIndexCache.append.
I moved this functionality into a new static VanillaIndexCache.append method, and called it from here.