changed map class into smaller classes