Extract the calculation of a difference into a separate method