Implemented caching by instance and by value