Make a start on migrating functions to classes