(doc) Refactored to use new fn middleware.