more code cleanup
Added activation & deactivation functions