refactored function-based generic views to class-based generic views