Global refactoring and reorganization.