New CORS middleware modularization