Replace HashMap with LinkedHashMap to preserve the order of the keys.