some cleanup and some more reorg.