@pjcozzi is correct (the assignment is definitely not necessary).  I would also change it to remove the unnecessary property lookups.  Get the 3 strings from contents and the beginning of the function and put them back at the end.