Code consolidation and reorginization