some interesting snippets to use in future addons