Refactor notify-fun