Refined the scripts