Refactoring scripts