more js code cleaning & adjustments: spacing, indents & missing semicolon