Turn into usable script with functions