Code clean up and add lines in certificate test scripts

Jira Issue: WP-346