Nice suggestion to refactor the repeated lines! Actually, these lines are in 7 functions. I leave out the first line since it is assigning to a different variable in the module scope and I'm not sure how to pass a variable by reference (in JavaScript) to the new private function.