Refactoring
Using an intermediate variable to get the text of the currently
selected item.