Refactoring for import/export functions