DB cleanup and minor reorg