Optimized Flow class