Added listener for list item selection
Refactoring...