Tidy up highlighter logic