Conversion to class based