code cleanup for results highlighting