Code cleanup and a few minor optimizations.
Code cleanup and a few minor optimizations.

NewEraCracker/pfsense,BlackstarGroup/pfsense,phil-davis/pfsense,ch1c4um/pfsense,NewEraCracker/pfsense,dennypage/pfsense,ch1c4um/pfsense,NOYB/pfsense,phil-davis/pfsense,jxmx/pfsense,pfsense/pfsense,NewEraCracker/pfsense,NOYB/pfsense,ch1c4um/pfsense,ptorsten/pfsense,dennypage/pfsense,NewEraCracker/pfsense,ptorsten/pfsense,pfsense/pfsense,jxmx/pfsense,phil-davis/pfsense,pfsense/pfsense,dennypage/pfsense,brunostein/pfsense,ch1c4um/pfsense,brunostein/pfsense,pfsense/pfsense,brunostein/pfsense,NOYB/pfsense,BlackstarGroup/pfsense,dennypage/pfsense,BlackstarGroup/pfsense,phil-davis/pfsense,jxmx/pfsense,BlackstarGroup/pfsense,ptorsten/pfsense