clean flags and data source that is compatible with final border names
and count