Simplify runAgent