Common utility functions & code for use in custom scripts.