Migrated function view to class based view