integrated _ methods into flush() function