Refactor Terriroty record