Added support to cache using HashMap