Use the faster StringBuilder instead of the thread-safe StringBuffer