map editor implementation & cleaning