"Refactoring" script