Improve notification code to avoid special casing.