refactor agent string