Refactored connect to irods