Added getMiddleware helpers for plugins