switched the middleware to an interface