Massive code reorganization