improve cpp snippets