some more cleaning, and some sanity tests