Optimization to flag