Performance improvements and compatibility with syntax highlighter