Moved function from a script to another