Moved caching into new class