assorted cleanup and reorg