Updated logic for instantiating imports to allow for IoC