Agents moving across nodes; refactoring