migrated functions to class