minor refactoring to reduce code redundancy
minor refactoring to reduce code redundancy

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