Split out define function into its own module