refactoring of highlighting