Refactoring and cleanups to orchestration scripts

Please read the docs to understand the design intent.
Oops missed that one. Also we should probably make a function of that expression to get the ip