more webtest cleanup and code improvement 

more webtest cleanup and code improvement