refactoring importfile.ts