kostas - refactoring of AgentTest