Functions flush(...) have been refactored.