Useful utilities and code snippets