refactor region management