modify interface to allow better reuse of the flush() method