Refactor snippets