clean up some functions