lots of misc cleanup