refactoring the highlighter