Remove unnecessary semicolon
Pull out function for repeated autodetection tests
Fix alignment of the variable assignments
Use initHighlighting instead of the manual setup