refactors index view