functions to classes