Refactor scripts.