refactored diff