split flushing and filling functions