Unify sync and deferred flush