Combine highlighting code into general utility code.