Update code to handle fact caching with non-dict implementations