minor utility code cleanup to avoid duplication
minor utility code cleanup to avoid duplication

roxyboy/cython,fperez/cython,encukou/cython,madjar/cython,c-blake/cython,achernet/cython,c-blake/cython,dahebolangkuan/cython,madjar/cython,scoder/cython,marscher/cython,roxyboy/cython,cython/cython,fabianrost84/cython,acrispin/cython,fabianrost84/cython,dahebolangkuan/cython,c-blake/cython,slonik-az/cython,madjar/cython,JelleZijlstra/cython,andreasvc/cython,dahebolangkuan/cython,scoder/cython,da-woods/cython,ChristopherHogan/cython,andreasvc/cython,roxyboy/cython,scoder/cython,slonik-az/cython,hhsprings/cython,achernet/cython,mcanthony/cython,hickford/cython,andreasvc/cython,marscher/cython,andreasvc/cython,encukou/cython,cython/cython,mrGeen/cython,hickford/cython,fperez/cython,mrGeen/cython,fperez/cython,achernet/cython,hhsprings/cython,hickford/cython,hhsprings/cython,fabianrost84/cython,encukou/cython,mcanthony/cython,JelleZijlstra/cython,mrGeen/cython,c-blake/cython,marscher/cython,achernet/cython,mrGeen/cython,hhsprings/cython,marscher/cython,andreasvc/cython,ChristopherHogan/cython,da-woods/cython,cython/cython,marscher/cython,mrGeen/cython,fperez/cython,da-woods/cython,slonik-az/cython,c-blake/cython,acrispin/cython,acrispin/cython,achernet/cython,hickford/cython,scoder/cython,fperez/cython,hhsprings/cython,JelleZijlstra/cython,roxyboy/cython,mcanthony/cython,hickford/cython,ChristopherHogan/cython,madjar/cython,encukou/cython,mcanthony/cython,madjar/cython,acrispin/cython,JelleZijlstra/cython,roxyboy/cython,slonik-az/cython,dahebolangkuan/cython,cython/cython,fabianrost84/cython,slonik-az/cython,mcanthony/cython,da-woods/cython,fabianrost84/cython,acrispin/cython,dahebolangkuan/cython,JelleZijlstra/cython,encukou/cython