Code cleaning and reorganization.