refactor location test

 into hasValidLocation() routine