simplification of populate_scope_map