Renamed some things and added middlewares that might be useful