this can be improved if you do this:

1. create a utility method in order to validate the string like this:

........... String method A(){
if(billingShippingHelper.getShipToState()!=null && billingShippingHelper.getShipToState().length() > 0) {
    snippetVar_shipToState = billingShippingHelper.getShipToState();      
 }
}