enhance commentary in get_map and clean up logic.