Move useful helpers setOn and getState into base class