separating the script as Facundo proposed