Refactor syntax highlighting into helper