Refactor to prepare for a sorted region structure (tree)