reduced number of local variables
replaced string builder with format