Added support for Express middleware functions