convert old functions into methods