CLSN-2107 : moving most of the logic to the data type part