Separate script by function