REFACTOR Agent tests