Refactor to make list view generic