refactor ssh