trying to rewrite getCachedBy() as global vars