Refactored list selection logic and renamed List to ListModel