cleaning and optimizing