a light refactoring and the first pieces of element map setting.