Extract out a superclass that encapsulates the flushing behaviour