Refactor selection.