Refactored to use class-based views.