Adding Agent refactoring.