map implementation and reorganization