refactor importall into its own function