cleaned up getTables

made the routine more concise