Fixed enable/disable message being broadcasted
Refactored source and add comments