change def to class