StringBuffer can safely be replaced with StringBuilder in these places.