cleaned middleware configuration
Formatted code