changed def to class for generic views