Various helpful code