cleanup and optimize notifications