Refactor and use Connection object as param in connect block to perform sftp actions on