Instead of modifying the `output` argument, handler should return the output, making handlers pure functions.
Instead of modifying the
outputargument, handler should return the output, making handlers pure functions.