Move flusher to separate function