I wonder if duplication here of `getSelectedIndex()` could be extracted into a variable and then `newClient` set with a ternary?