Refactoring the index view