Convert some functions to classes