code cleanup and reorg in prep for proper rocket mode fix