Optimization framework