build-totals takes a better structure