The function of mindfulness is to purify. It means we have to understand what purity is – what qualities cause problems, stress and contamination, an which are bright, fortifying and calming. Right view and right attitude inform the careful attention that leads to purification.
In Dhamma practice we aim to establish positive roots that can nourish our everyday actions and behaviors. We train in setting aside what is unskillful and causes stress, and lingering in and strengthening factors for awakening. The 5 indriya offer a beneficial domain for such cultivation.
Dukkha is dependently originating with tanha (demands), demands are dependently originating with preference, preference is dependently originating with unquestioned belief in the subjective arising of vedana. But more and more peace is possible.