remove duplicated code from notificationview