cleaned up notifications code