refactor(agent): refactor it all