Moved cache to seperate class and enabled caching of non file object