adding logic to embed encoded snippets