Moved StringBuilder initialized within the loop