refactoring scripting.