remove notify if user left and  organize the code