factor out Direction.getClosestStop