Simplify documentObserver logic.