Fix for issue #8023

Can someone code review.
@jorisvandenbossche ok will do, i thought this would be better because when 1 function changes then the other will have to be updated.