Script refactoring.