Just some code cleanup and reorg