refining script