Lots of little refinements and simplifications