improved some snippets