improve efficiency of syntax highlighter

closes #111