improved diff builder