add the fetch ref to the folds, and improve the way the fold numbers are calculated