Started moving functions into a class