The cosmic microwave background (CMB) holds valuable information about the early Universe, including an imprint of its mass distribution that overshadows the faint signal from primordial gravitational waves, likely generated during inflation. Removing this imprint is crucial for future CMB observations to tightly constrain the tensor-to-scalar ratio r. This talk focuses on achieving the tightest bounds on r using CMB-S4, PICO, and a novel optimal lensing reconstruction method via the maximum a-posteriori (MAP) point (and published as delensalot - https://github.com/NextGenCMB/delensalot/). I will also address the impact of a realistic bispectrum in the deflection field and present the most accurate and fastest algorithms for non-uniform spherical harmonic transforms on CPU (lenspyx) and CPU/GPU (cunuSHT).