Moved middlewares into their own files.