cleanup and various adjustments