No need to call get_class twice

Ref. #4839