Replacing ssh to agent-ssh and refactoring agent-exec.