Clean up deactivate script to be more 'angular-esque'