Seperated the logic of with-list-collector from accumulate-range.