integrate snippets into completion, some minor cleanup