Abstracted isValidLocation method from sameRoute