There is still a lot of duplication here. Any way to remove it? If you just `exec` you probably don't need the check old versions and thor debug stuff.