refactoring and standalone diff_nexson.py