Mod: move the function definition to  definition file