restructure map class