cleaning up a bunch of functions