Factored out syntax highlighting into a separate function for repeated, varying calls