replace elementDictionary by a class