Extract configuration into method
Add middlewares configuration
Extract functions into methods