Extracting logic around inserting import statements into its own module, with more descriptive function names