optimized flow