Moved smart_cache functionality to own class