Refactored viewsRefresh().

Need to have back-index visiting in the outer loop rather
than the inner loop.