Refactor code highlighting and visualizing