Change index to class-based view.