move main code into import-table function