  To push the radial velocity (RV) exoplanet detection threshold, it is crucial
to find more reliable radial velocity extraction methods. The Least-Squares
Deconvolution (LSD) technique has been used to infer the stellar magnetic flux
from spectropolarimetric data for the past two decades. It relies on the
assumption that stellar absorption lines are similar in shape. Although this
assumption is simplistic, LSD provides a good model for intensity spectra and
likewise an estimate for their Doppler shift. We present the Multi-Mask
Least-Squares Deconvolution (MM-LSD) RV extraction pipeline which extracts the
radial velocity from two-dimensional echelle-order spectra using LSD with
multiple tailored masks after continuum normalisation and telluric absorption
line correction. The flexibility of LSD allows to exclude spectral lines or
pixels at will, providing a means to exclude variable lines or pixels affected
by instrumental problems. The MM-LSD pipeline was tested on HARPS-N data for
the Sun and selected well-observed stars with 5.7 < Vmag < 12.6. For FGK-type
stars with median signal-to-noise above 100, the pipeline delivered RV time
series with on average 12 per cent lower scatter as compared to the HARPS-N RV
extraction pipeline based on the Cross-Correlation Function technique. The
MM-LSD pipeline may be used as a standalone RV code, or modified and extended
to extract a proxy for the magnetic field strength.
