notify: factor out code path only used by one caller