Refactoring scripts.
More refactoring.