Refactor the "highlighter" related code