Listview: some refactoring