Moving the table names out of the connect loop, renaming method