generalize setting region flags