Use folds to reorganize code.