a bunch of cleanup