Fixes broken deactivate method

It also includes refactoring of `handlingRemoveTerm` in a more coffeescriptish way