Code cleaning and optimization.