refactor awd->flush to reorder blocks before export.