A new approach to cosmological perturbations in f(R) models