this was a copy-and-paste refactoring.  the diff is weird b/c of the indentation and some lines that were duplicated in the origin function.