Updating connection

making some updates to make connection method more generic.