Add missing finality check on state equivalency check
reorganize some functions