Remove code duplication
Merge pull request #10331 from neerajdotname/exec-migration-in-transaction

Remove code duplication