Moved middleware [MJ-389]

All tests pass.