Some refactoring in hashmap and dl-list