Reduced the number of overall copies during the processing.
Changed function pointer to function reference.