Better use of optimization_window