condensing cache copy function into one