simplify code by removing flush logic from protocol