improved caching strategy