Refactored to give a common interface for toggle buttons.
Merge