refactor: the middlewares array is now allocated in the Agito class