refactor load_map