migrated function based to class based views