WIP for refactored scripting write