simplified caching implementation