Fix middleware and illustrate middleware order
Merge branch 'feature/split-middleware' into all-features-merged