Refactor: extract methods in SnippetManager.