refactor and tweak territory sequence