refactored the diff