cleaner implementation of dynamic snippets