Rename a global function to a script local one