Refactor with class-based views.