Enhance session diff function