little refactoring in flush
add incremented counters