Reworked the agent hierarchy