-- webtest fixes and improvement

Made some webtest fixes and improved code by using the helper functions.