Can you refactor the code for adding references, initializing script packs and termination into it's own functions? I suspect these may evolve over time and they don't need to be in the execute method.