Simplifying this code by using other structures.
Simplifying this code by using other structures.

LGTM Mike.

michael-berlin/vitess,SDHM/vitess,CERN-Stage-3/vitess,cgvarela/vitess,skyportsystems/vitess,dumbunny/vitess,yangzhongj/vitess,mapbased/vitess,yangzhongj/vitess,pivanof/vitess,alainjobart/vitess,cgvarela/vitess,erzel/vitess,apmichaud/vitess-apm,ptomasroos/vitess,dcadevil/vitess,guokeno0/vitess,anusornc/vitess,enisoc/vitess,nurblieh/vitess,applift/vitess,AndyDiamondstein/vitess,alainjobart/vitess,rnavarro/vitess,michael-berlin/vitess,ngaut/vitess,kuipertan/vitess,cloudbearings/vitess,CERN-Stage-3/vitess,CERN-Stage-3/vitess,nurblieh/vitess,mlc0202/vitess,nurblieh/vitess,atyenoria/vitess,applift/vitess,HubSpot/vitess,davygeek/vitess,kuipertan/vitess,guokeno0/vitess,applift/vitess,netroby/vitess,aaijazi/vitess,SDHM/vitess,apmichaud/vitess-apm,SDHM/vitess,anusornc/vitess,cgvarela/vitess,tjyang/vitess,tirsen/vitess,alainjobart/vitess,michael-berlin/vitess,aaijazi/vitess,davygeek/vitess,mattharden/vitess,mlc0202/vitess,kmiku7/vitess-annotated,ngaut/vitess,sougou/vitess,mahak/vitess,ptomasroos/vitess,yangzhongj/vitess,CERN-Stage-3/vitess,AndyDiamondstein/vitess,mlc0202/vitess,SDHM/vitess,yangzhongj/vitess,HeisenbergUncertain/vitess,davygeek/vitess,yaoshengzhe/vitess,yangzhongj/vitess,vitessio/vitess,tjyang/vitess,mattharden/vitess,michael-berlin/vitess,vitessio/vitess,ptomasroos/vitess,tinyspeck/vitess,HeisenbergUncertain/vitess,mlc0202/vitess,anusornc/vitess,AndyDiamondstein/vitess,cloudbearings/vitess,tinyspeck/vitess,fengshao0907/vitess,pivanof/vitess,skyportsystems/vitess,pivanof/vitess,ngaut/vitess,aaijazi/vitess,applift/vitess,cgvarela/vitess,cgvarela/vitess,mapbased/vitess,SDHM/vitess,vitessio/vitess,rnavarro/vitess,HubSpot/vitess,erzel/vitess,mlc0202/vitess,anusornc/vitess,michael-berlin/vitess,applift/vitess,tirsen/vitess,fengshao0907/vitess,fengshao0907/vitess,rnavarro/vitess,cloudbearings/vitess,anusornc/vitess,dumbunny/vitess,fengshao0907/vitess,sougou/vitess,davygeek/vitess,aaijazi/vitess,ptomasroos/vitess,mattharden/vitess,erzel/vitess,yangzhongj/vitess,enisoc/vitess,yaoshengzhe/vitess,xgwubin/vitess,tirsen/vitess,skyportsystems/vitess,yaoshengzhe/vitess,apmichaud/vitess-apm,tjyang/vitess,mapbased/vitess,anusornc/vitess,yangzhongj/vitess,enisoc/vitess,nurblieh/vitess,davygeek/vitess,davygeek/vitess,dcadevil/vitess,AndyDiamondstein/vitess,sougou/vitess,tirsen/vitess,kmiku7/vitess-annotated,nurblieh/vitess,mattharden/vitess,netroby/vitess,ngaut/vitess,rnavarro/vitess,nurblieh/vitess,mapbased/vitess,kmiku7/vitess-annotated,dumbunny/vitess,dumbunny/vitess,mahak/vitess,dumbunny/vitess,kuipertan/vitess,mapbased/vitess,yangzhongj/vitess,yaoshengzhe/vitess,michael-berlin/vitess,mattharden/vitess,rnavarro/vitess,netroby/vitess,AndyDiamondstein/vitess,mattharden/vitess,HubSpot/vitess,enisoc/vitess,HubSpot/vitess,yangzhongj/vitess,vitessio/vitess,aaijazi/vitess,cloudbearings/vitess,tinyspeck/vitess,kuipertan/vitess,kuipertan/vitess,apmichaud/vitess-apm,alainjobart/vitess,mahak/vitess,atyenoria/vitess,yaoshengzhe/vitess,guokeno0/vitess,erzel/vitess,fengshao0907/vitess,anusornc/vitess,netroby/vitess,ptomasroos/vitess,HubSpot/vitess,dumbunny/vitess,dumbunny/vitess,kmiku7/vitess-annotated,vitessio/vitess,nurblieh/vitess,rnavarro/vitess,skyportsystems/vitess,mapbased/vitess,kuipertan/vitess,mattharden/vitess,tirsen/vitess,sougou/vitess,cgvarela/vitess,HubSpot/vitess,atyenoria/vitess,guokeno0/vitess,guokeno0/vitess,tirsen/vitess,AndyDiamondstein/vitess,tjyang/vitess,skyportsystems/vitess,xgwubin/vitess,kmiku7/vitess-annotated,tirsen/vitess,mapbased/vitess,dcadevil/vitess,erzel/vitess,xgwubin/vitess,xgwubin/vitess,rnavarro/vitess,enisoc/vitess,pivanof/vitess,mahak/vitess,pivanof/vitess,mahak/vitess,ptomasroos/vitess,skyportsystems/vitess,tjyang/vitess,pivanof/vitess,cgvarela/vitess,anusornc/vitess,dcadevil/vitess,erzel/vitess,atyenoria/vitess,dcadevil/vitess,sougou/vitess,ptomasroos/vitess,fengshao0907/vitess,mlc0202/vitess,enisoc/vitess,alainjobart/vitess,rnavarro/vitess,sougou/vitess,SDHM/vitess,atyenoria/vitess,tinyspeck/vitess,dumbunny/vitess,apmichaud/vitess-apm,kmiku7/vitess-annotated,xgwubin/vitess,mlc0202/vitess,dumbunny/vitess,tinyspeck/vitess,sougou/vitess,davygeek/vitess,atyenoria/vitess,cloudbearings/vitess,cloudbearings/vitess,kmiku7/vitess-annotated,mattharden/vitess,enisoc/vitess,HeisenbergUncertain/vitess,dcadevil/vitess,AndyDiamondstein/vitess,kmiku7/vitess-annotated,mapbased/vitess,erzel/vitess,kuipertan/vitess,mattharden/vitess,yaoshengzhe/vitess,HubSpot/vitess,netroby/vitess,tjyang/vitess,nurblieh/vitess,vitessio/vitess,michael-berlin/vitess,SDHM/vitess,xgwubin/vitess,aaijazi/vitess,tirsen/vitess,atyenoria/vitess,CERN-Stage-3/vitess,HubSpot/vitess,netroby/vitess,atyenoria/vitess,AndyDiamondstein/vitess,skyportsystems/vitess,ngaut/vitess,tjyang/vitess,netroby/vitess,skyportsystems/vitess,pivanof/vitess,fengshao0907/vitess,applift/vitess,pivanof/vitess,alainjobart/vitess,tinyspeck/vitess,SDHM/vitess,ptomasroos/vitess,dcadevil/vitess,guokeno0/vitess,cgvarela/vitess,anusornc/vitess,xgwubin/vitess,aaijazi/vitess,guokeno0/vitess,skyportsystems/vitess,vitessio/vitess,tjyang/vitess,applift/vitess,nurblieh/vitess,netroby/vitess,xgwubin/vitess,rnavarro/vitess,mahak/vitess,cloudbearings/vitess,erzel/vitess,pivanof/vitess,aaijazi/vitess,kuipertan/vitess,tirsen/vitess,applift/vitess,tinyspeck/vitess,mlc0202/vitess,yaoshengzhe/vitess,sougou/vitess,alainjobart/vitess,SDHM/vitess,cloudbearings/vitess,mapbased/vitess,applift/vitess,erzel/vitess,aaijazi/vitess,mahak/vitess,HeisenbergUncertain/vitess,vitessio/vitess,xgwubin/vitess,erzel/vitess,ptomasroos/vitess,netroby/vitess,guokeno0/vitess,yaoshengzhe/vitess,alainjobart/vitess,mahak/vitess,yaoshengzhe/vitess,fengshao0907/vitess,cloudbearings/vitess,applift/vitess,fengshao0907/vitess,michael-berlin/vitess,mlc0202/vitess,mattharden/vitess,cgvarela/vitess,kmiku7/vitess-annotated,guokeno0/vitess,tjyang/vitess,mapbased/vitess,dumbunny/vitess,michael-berlin/vitess,kuipertan/vitess,atyenoria/vitess,AndyDiamondstein/vitess