moved most of the functions into their own classes. Everything is probably broken though