Common functions, helpers, and extensions