cleaned up notification code