Added MapElement, refactoring