Clean up convert command generation code.