cleanup and rotation work