Change to script local function

Because there are no need to call this function from other files.