Cleanup of Analysis and Optimization