introduced the use of std::unique_ptr for storing the cached objects