First cut of this
Start to move logic out of the agent