Using apply leads to implementation limits in the number of arguments which are fairly low. Refactoring everything as folds allows to handle an arbitrary number of datapoints.