Refactored `observer.discard()` to act as a Getter or Setter with an optional parameter