refining scripts