some useful snippets