Refactor: extra: use $(...) instead of ... in agent code
more modern, and works better with nested quotes