Clean up delete external id script to be more 'angular-esque'