ping code cleanup, ssh_session for interactive ssh with switches added