refactor duplicated code
refactor duplicated code

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