Simplify ssh loop