Reduce code duplication between Berendsen and c-rescale pressure coupling