changing `delegate` and `undelegate` to `on` and `off`