javascript: minor changes in variable names and formatting