Attempted clean up of T4 code with string builder

added string builder to help readabilty of T4