renamed: middlewares => middleware, fixed tests