Replace HashMap with own implementation