[minor] add function for result construction to avoid duplicate code
[minor] add function for result construction to avoid duplicate code

mozilla/mig,jboyer2012/mig,mozilla/mig,jvehent/mig,rayyang2000/mig,datachand/mig,rezen/mig,deathping1994/mig,mvanotti/mig,ameihm0912/mig,rayyang2000/mig,jvehent/mig,zerosign/mig,rezen/mig,gdestuynder/mig,rezen/mig,mvanotti/mig,rayyang2000/mig,jvehent/mig,jboyer2012/mig,vladimirdiaconescu/mig,jvehent/mig,mvanotti/mig,mozilla/mig,yvesago/mig,rayyang2000/mig,sunnygkp10/mig,jboyer2012/mig,therealkbhat/mig,pap/mig,therealkbhat/mig,yvesago/mig,deathping1994/mig,ameihm0912/mig,jboyer2012/mig,mvanotti/mig,yvesago/mig,gdestuynder/mig,mozilla/mig,vladimirdiaconescu/mig,deathping1994/mig,zerosign/mig,yvesago/mig,datachand/mig,therealkbhat/mig,gdestuynder/mig,rezen/mig,datachand/mig,zerosign/mig,pap/mig,vladimirdiaconescu/mig,pap/mig,sunnygkp10/mig,vladimirdiaconescu/mig,deathping1994/mig,mozilla/mig,therealkbhat/mig,gdestuynder/mig,ameihm0912/mig,datachand/mig,zerosign/mig,sunnygkp10/mig,pap/mig,sunnygkp10/mig