Update style and fix some code snippet formatting