Starting refactor of scripting app