refactor main:
create function run_ssh, copy_ssh, get_ssh
run new func