refactor diff