various minor tweaks, and rearrange to put "important" changes near the top