major refactoring elements -> elementsDict