Refactor: now using funnel as a middleware.