AreValidCoordinates refactured