Pulling import function out of main and clearing out tables as they are imported.