move proper encoding function to class string