Extract getCoordinates method