Add syntactic highlighting and refactor code