Continuing refactor import function.