replaced String.Format(s) with sprintf and cleaned up StringBuilder appends