re-org for agents to be more pluggable