more refactoring for snippets post