minor refactoring
refactor diff generation