Moved caching earlier