Clean up code in check-templates.
Clean up code in check-templates.

I extracted a few helper methods.

dawran6/zulip,amyliu345/zulip,vikas-parashar/zulip,amanharitsh123/zulip,aakash-cr7/zulip,sonali0901/zulip,hackerkid/zulip,arpith/zulip,brockwhittaker/zulip,joyhchen/zulip,samatdav/zulip,TigorC/zulip,kou/zulip,hackerkid/zulip,cosmicAsymmetry/zulip,Galexrt/zulip,sharmaeklavya2/zulip,peguin40/zulip,peguin40/zulip,showell/zulip,christi3k/zulip,jackrzhang/zulip,calvinleenyc/zulip,sharmaeklavya2/zulip,dhcrzf/zulip,synicalsyntax/zulip,SmartPeople/zulip,andersk/zulip,samatdav/zulip,sharmaeklavya2/zulip,j831/zulip,souravbadami/zulip,TigorC/zulip,christi3k/zulip,j831/zulip,timabbott/zulip,niftynei/zulip,blaze225/zulip,sup95/zulip,kou/zulip,souravbadami/zulip,Juanvulcano/zulip,zulip/zulip,umkay/zulip,umkay/zulip,ahmadassaf/zulip,vikas-parashar/zulip,peguin40/zulip,blaze225/zulip,isht3/zulip,calvinleenyc/zulip,amanharitsh123/zulip,kou/zulip,paxapy/zulip,synicalsyntax/zulip,jrowan/zulip,cosmicAsymmetry/zulip,Jianchun1/zulip,mahim97/zulip,samatdav/zulip,ryanbackman/zulip,eeshangarg/zulip,joyhchen/zulip,paxapy/zulip,tommyip/zulip,krtkmj/zulip,grave-w-grave/zulip,AZtheAsian/zulip,mohsenSy/zulip,AZtheAsian/zulip,showell/zulip,amanharitsh123/zulip,Diptanshu8/zulip,zulip/zulip,isht3/zulip,dawran6/zulip,vaidap/zulip,PhilSk/zulip,PhilSk/zulip,Juanvulcano/zulip,Galexrt/zulip,shubhamdhama/zulip,sup95/zulip,kou/zulip,dawran6/zulip,SmartPeople/zulip,Jianchun1/zulip,rishig/zulip,susansls/zulip,timabbott/zulip,Jianchun1/zulip,TigorC/zulip,mahim97/zulip,vikas-parashar/zulip,rishig/zulip,reyha/zulip,Jianchun1/zulip,jphilipsen05/zulip,TigorC/zulip,niftynei/zulip,rht/zulip,christi3k/zulip,shubhamdhama/zulip,brainwane/zulip,shubhamdhama/zulip,mohsenSy/zulip,jackrzhang/zulip,SmartPeople/zulip,brainwane/zulip,timabbott/zulip,krtkmj/zulip,KingxBanana/zulip,dhcrzf/zulip,isht3/zulip,timabbott/zulip,souravbadami/zulip,amyliu345/zulip,brainwane/zulip,jrowan/zulip,vaidap/zulip,arpith/zulip,KingxBanana/zulip,peguin40/zulip,jackrzhang/zulip,sonali0901/zulip,KingxBanana/zulip,isht3/zulip,shubhamdhama/zulip,jphilipsen05/zulip,vabs22/zulip,hackerkid/zulip,JPJPJPOPOP/zulip,aakash-cr7/zulip,susansls/zulip,brockwhittaker/zulip,amanharitsh123/zulip,sonali0901/zulip,KingxBanana/zulip,rht/zulip,Jianchun1/zulip,vabs22/zulip,umkay/zulip,arpith/zulip,mahim97/zulip,niftynei/zulip,joyhchen/zulip,JPJPJPOPOP/zulip,jackrzhang/zulip,punchagan/zulip,mahim97/zulip,jrowan/zulip,amanharitsh123/zulip,calvinleenyc/zulip,vabs22/zulip,niftynei/zulip,umkay/zulip,shubhamdhama/zulip,grave-w-grave/zulip,andersk/zulip,rishig/zulip,kou/zulip,punchagan/zulip,zacps/zulip,ahmadassaf/zulip,susansls/zulip,tommyip/zulip,ryanbackman/zulip,zacps/zulip,sharmaeklavya2/zulip,punchagan/zulip,paxapy/zulip,Juanvulcano/zulip,souravbadami/zulip,Diptanshu8/zulip,aakash-cr7/zulip,grave-w-grave/zulip,sonali0901/zulip,arpith/zulip,tommyip/zulip,PhilSk/zulip,jainayush975/zulip,calvinleenyc/zulip,showell/zulip,vaidap/zulip,jainayush975/zulip,rht/zulip,blaze225/zulip,aakash-cr7/zulip,kou/zulip,brockwhittaker/zulip,umkay/zulip,brainwane/zulip,krtkmj/zulip,synicalsyntax/zulip,dhcrzf/zulip,ahmadassaf/zulip,jrowan/zulip,mahim97/zulip,dhcrzf/zulip,Diptanshu8/zulip,hackerkid/zulip,rishig/zulip,j831/zulip,j831/zulip,dhcrzf/zulip,punchagan/zulip,reyha/zulip,ahmadassaf/zulip,synicalsyntax/zulip,jainayush975/zulip,christi3k/zulip,calvinleenyc/zulip,dawran6/zulip,samatdav/zulip,arpith/zulip,niftynei/zulip,JPJPJPOPOP/zulip,joyhchen/zulip,paxapy/zulip,vaidap/zulip,andersk/zulip,cosmicAsymmetry/zulip,jainayush975/zulip,showell/zulip,calvinleenyc/zulip,eeshangarg/zulip,tommyip/zulip,brainwane/zulip,krtkmj/zulip,aakash-cr7/zulip,amyliu345/zulip,synicalsyntax/zulip,tommyip/zulip,joyhchen/zulip,reyha/zulip,jackrzhang/zulip,Diptanshu8/zulip,Juanvulcano/zulip,AZtheAsian/zulip,jphilipsen05/zulip,eeshangarg/zulip,zacps/zulip,brockwhittaker/zulip,Galexrt/zulip,jphilipsen05/zulip,dattatreya303/zulip,grave-w-grave/zulip,zacps/zulip,synicalsyntax/zulip,christi3k/zulip,brainwane/zulip,eeshangarg/zulip,vabs22/zulip,dawran6/zulip,arpith/zulip,eeshangarg/zulip,dattatreya303/zulip,JPJPJPOPOP/zulip,jrowan/zulip,AZtheAsian/zulip,isht3/zulip,vaidap/zulip,brainwane/zulip,cosmicAsymmetry/zulip,rishig/zulip,timabbott/zulip,ryanbackman/zulip,Galexrt/zulip,SmartPeople/zulip,sup95/zulip,peguin40/zulip,showell/zulip,paxapy/zulip,zulip/zulip,reyha/zulip,dhcrzf/zulip,timabbott/zulip,dattatreya303/zulip,christi3k/zulip,TigorC/zulip,JPJPJPOPOP/zulip,mohsenSy/zulip,vikas-parashar/zulip,verma-varsha/zulip,zacps/zulip,blaze225/zulip,vabs22/zulip,samatdav/zulip,punchagan/zulip,eeshangarg/zulip,zulip/zulip,amyliu345/zulip,verma-varsha/zulip,verma-varsha/zulip,rishig/zulip,ahmadassaf/zulip,SmartPeople/zulip,sup95/zulip,shubhamdhama/zulip,samatdav/zulip,ryanbackman/zulip,PhilSk/zulip,niftynei/zulip,AZtheAsian/zulip,sonali0901/zulip,Galexrt/zulip,vabs22/zulip,TigorC/zulip,ahmadassaf/zulip,verma-varsha/zulip,zacps/zulip,timabbott/zulip,jrowan/zulip,SmartPeople/zulip,andersk/zulip,vaidap/zulip,susansls/zulip,souravbadami/zulip,PhilSk/zulip,ryanbackman/zulip,dattatreya303/zulip,ahmadassaf/zulip,umkay/zulip,KingxBanana/zulip,reyha/zulip,isht3/zulip,jackrzhang/zulip,peguin40/zulip,mohsenSy/zulip,shubhamdhama/zulip,dattatreya303/zulip,AZtheAsian/zulip,amyliu345/zulip,krtkmj/zulip,showell/zulip,mahim97/zulip,sup95/zulip,j831/zulip,sonali0901/zulip,hackerkid/zulip,aakash-cr7/zulip,sharmaeklavya2/zulip,showell/zulip,brockwhittaker/zulip,krtkmj/zulip,rht/zulip,kou/zulip,PhilSk/zulip,mohsenSy/zulip,cosmicAsymmetry/zulip,eeshangarg/zulip,Diptanshu8/zulip,jackrzhang/zulip,rht/zulip,hackerkid/zulip,vikas-parashar/zulip,rht/zulip,Diptanshu8/zulip,andersk/zulip,vikas-parashar/zulip,grave-w-grave/zulip,rishig/zulip,j831/zulip,dhcrzf/zulip,reyha/zulip,KingxBanana/zulip,paxapy/zulip,Galexrt/zulip,umkay/zulip,rht/zulip,susansls/zulip,dawran6/zulip,zulip/zulip,sharmaeklavya2/zulip,hackerkid/zulip,andersk/zulip,Juanvulcano/zulip,amyliu345/zulip,punchagan/zulip,souravbadami/zulip,jainayush975/zulip,blaze225/zulip,zulip/zulip,tommyip/zulip,sup95/zulip,susansls/zulip,tommyip/zulip,verma-varsha/zulip,Galexrt/zulip,zulip/zulip,punchagan/zulip,synicalsyntax/zulip,mohsenSy/zulip,ryanbackman/zulip,verma-varsha/zulip,joyhchen/zulip,Juanvulcano/zulip,grave-w-grave/zulip,amanharitsh123/zulip,Jianchun1/zulip,jphilipsen05/zulip,andersk/zulip,jainayush975/zulip,dattatreya303/zulip,blaze225/zulip,brockwhittaker/zulip,cosmicAsymmetry/zulip,jphilipsen05/zulip,JPJPJPOPOP/zulip,krtkmj/zulip