Remove QDebug code and simplify insertSnippet()