only notify if not foreground
remove unused args
clean up code