Simplifying the difference logic