refactor
Agent class