Can most of this string be pulled out into a variable and used in the line below?