Refactoring in script.