Middleware improvement.