Changed cache to hashmap