scripts refined with changes