Refactored import function into separate file