misc. reorg of whole chunks of code