Refactored to pull common code from import and seed.