substitute continue with else block of try-except statement. Use additional finally block instead of 4 if-checks for notification.