agent containing refactoring