Decompose maximum inflight size calculation.
Extract resending lost packet to function.
Extract acknowledged sent packets removal to method.