Refactoring, script generator