Updated code to reduce the amount of garbage created, mostly in Strings