[api] improve comment notification code structure