So basically the initialization routine that you have here could be put in its own method where the key is being passed in as an argument, and you resolve all the things you resolve here and store that in a custom type and add that custom type instance to a dictionary based on the type of the cache entry (you'll need to return that one as well in the custom type)