refactor(dom) getSelectedNames: for -> map