Moved redundant validation code to a separate function
Moved redundant validation code to a separate function

damienfir/Halide,gchauras/Halide,fengzhyuan/Halide,jiawen/Halide,gchauras/Halide,delcypher/Halide,adasworks/Halide,dan-tull/Halide,kenkuang1213/Halide,dan-tull/Halide,dan-tull/Halide,adasworks/Halide,psuriana/Halide,ayanazmat/Halide,adasworks/Halide,dan-tull/Halide,kgnk/Halide,lglucin/Halide,aam/Halide,jiawen/Halide,ronen/Halide,dougkwan/Halide,ronen/Halide,dougkwan/Halide,adasworks/Halide,tdenniston/Halide,smxlong/Halide,fengzhyuan/Halide,mcanthony/Halide,mcanthony/Halide,fengzhyuan/Halide,mcanthony/Halide,aam/Halide,delcypher/Halide,ronen/Halide,ronen/Halide,smxlong/Halide,kgnk/Halide,gchauras/Halide,kenkuang1213/Halide,myrtleTree33/Halide,aam/Halide,kgnk/Halide,gchauras/Halide,myrtleTree33/Halide,smxlong/Halide,ayanazmat/Halide,kgnk/Halide,rodrigob/Halide,kenkuang1213/Halide,ronen/Halide,lglucin/Halide,smxlong/Halide,ronen/Halide,gchauras/Halide,lglucin/Halide,fengzhyuan/Halide,adasworks/Halide,myrtleTree33/Halide,rodrigob/Halide,psuriana/Halide,dan-tull/Halide,rodrigob/Halide,delcypher/Halide,kgnk/Halide,dougkwan/Halide,dougkwan/Halide,jiawen/Halide,damienfir/Halide,ayanazmat/Halide,jiawen/Halide,smxlong/Halide,ayanazmat/Halide,lglucin/Halide,jiawen/Halide,rodrigob/Halide,adasworks/Halide,lglucin/Halide,jiawen/Halide,myrtleTree33/Halide,delcypher/Halide,tdenniston/Halide,mcanthony/Halide,tdenniston/Halide,kenkuang1213/Halide,fengzhyuan/Halide,smxlong/Halide,rodrigob/Halide,dougkwan/Halide,adasworks/Halide,smxlong/Halide,gchauras/Halide,dan-tull/Halide,psuriana/Halide,myrtleTree33/Halide,myrtleTree33/Halide,rodrigob/Halide,damienfir/Halide,fengzhyuan/Halide,psuriana/Halide,dan-tull/Halide,aam/Halide,tdenniston/Halide,tdenniston/Halide,damienfir/Halide,kgnk/Halide,dougkwan/Halide,dougkwan/Halide,kgnk/Halide,ayanazmat/Halide,delcypher/Halide,aam/Halide,kenkuang1213/Halide,rodrigob/Halide,kenkuang1213/Halide,tdenniston/Halide,ayanazmat/Halide,adasworks/Halide,lglucin/Halide,dougkwan/Halide,ronen/Halide,psuriana/Halide,kenkuang1213/Halide,delcypher/Halide,lglucin/Halide,mcanthony/Halide,delcypher/Halide,psuriana/Halide,psuriana/Halide,mcanthony/Halide,fengzhyuan/Halide,tdenniston/Halide,damienfir/Halide,mcanthony/Halide,ayanazmat/Halide,rodrigob/Halide,damienfir/Halide,kenkuang1213/Halide,myrtleTree33/Halide,damienfir/Halide,ronen/Halide,ayanazmat/Halide,smxlong/Halide,aam/Halide,jiawen/Halide,fengzhyuan/Halide,damienfir/Halide,dan-tull/Halide,mcanthony/Halide,tdenniston/Halide,kgnk/Halide,delcypher/Halide,myrtleTree33/Halide,aam/Halide