Miscellaneous snippets of code